package com.antd.common.sms;

import com.antd.common.sms.listener.SysSmsLogListener;
import com.antd.common.sms.util.SmsSendService;
import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.ApplicationEventPublisher;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.annotation.EnableAsync;

/**
 * TODO
 *
 * @author 子丶沫
 * @version 1.0
 * @date 2020/12/2 11:18
 */
@Configuration
@EnableFeignClients(value = "com.antd.common.sms.fegin")
@EnableAsync
@ConditionalOnWebApplication
public class SmsAutoConfig {
    @Bean
    public SysSmsLogListener sysSmsLogListener(){
        return  new SysSmsLogListener();
    }
    @Bean
    public SmsSendService smsSendService(ApplicationEventPublisher publisher){
        return new SmsSendService(publisher);
    }
}
